﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LoanPaymentSchedule.aspx.cs" Inherits="CRMWeb.Pages.AM.LoanPaymentSchedule" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="/EasyUI/Themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="/EasyUI/Themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="/Css/CrmStyle.css" />
    <script type="text/javascript" src="/Scripts/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="/EasyUI/jquery.easyui.min.js"></script>
</head>
<body>
    <table id="dgPaymentSchedule" title="PAYMENT SCHEDULE" class="easyui-datagrid" style="width: 580px; height: 335px"
        data-options="url:'/WebServices/AM/LoanForm.ashx?method=DisplayPaymentSchedule&LoanID='+getQuerystring('LoanID', '') + '&paraPurpose=' + getQuerystring('purpose', '') + '&paraProduct=' + getQuerystring(encodeURIComponent('Product'),'') + '&paraType=' + getQuerystring(encodeURIComponent('Type'),'') + '&paraSettlementDate=' + getQuerystring('DrowDowndate', '') + '&paraTerm=' + getQuerystring('LoanTerm', '') + '&paraFirstPaymentDate=' + getQuerystring('FirstPaymentDue', '') + '&paraPaymetFrequecy=' + getQuerystring('paymentperiod', '') + '&paraAnnumInterestRate=' + getQuerystring('LowerRate', '') + '&paraInterestMethod=' + getQuerystring('InterestMethod', '') + '&paraLoanAmount=' + getQuerystring('LoanAmount', '')"
        rownumbers="true" fitcolumns="true" singleselect="true">
        <thead>
            <tr>
                <th field="date" width="60" data-options="formatter:formatLoanDate">Due Date</th>
                <th field="day" width="50">Day</th>
                <th field="amount" width="50">Payment</th>
            </tr>
        </thead>
    </table>
    <script type="text/javascript">
        //get querystring value
        function getQuerystring(key, defaultValue) {
            if (defaultValue == null) defaultValue = "";
            key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
            var qs = regex.exec(window.location.href);
            if (qs == null)
                return defaultValue;
            else {
                return qs[1];
            }
        }
       
        function formatLoanDate(value, row) {
            if (value == null)
                return value;
            var date = new Date(value);
            var y = date.getFullYear();
            var m = date.getMonth() + 1;
            var d = date.getDate();
            return (d < 10 ? ('0' + d) : d) + '/' + (m < 10 ? ('0' + m) : m) + '/' + y;
        }
    </script>
</body>
</html>
